import request from '@/utils/request'
// import {exportMethod} from '@/utils/utils'
import * as proxy from '@/constants/proxy'
import { exportMethod } from '@/utils/utils'

//技术工法

// 增加
export function getAdd(data: any) {
  return request({
    url: proxy.CHECC_API_CMS + '/kjsl/tresult/contribute/techmethod/add',
    method: 'post',
    data
  })
}

// 更新
export function getUpdate(data: any) {
  return request({
    url: proxy.CHECC_API_CMS + '/kjsl/tresult/contribute/techmethod/update',
    method: 'post',
    data
  })
}



// 列表数据 
export function getList(params: any) {
  return request({
    url: proxy.CHECC_API_CMS + '/kjsl/tresult/contribute/techmethod/list',
    method: 'post',
    params
  })
}

//获取详情
export function getDetail(id: any) {
  return request({
    url: proxy.CHECC_API_CMS + `/kjsl/tresult/contribute/techmethod/getDetailById?id=` + id,
    method: 'post',
  })
}

//解锁
export function getUnlock(data: any) {
  return request({
      url: proxy.CHECC_API_CMS + '/kjsl/tresult/contribute/techmethod/unlock/' + data,
      method: 'get',
  })
}


//锁定
export function getLock(data: any) {
  return request({
      url: proxy.CHECC_API_CMS + '/kjsl/tresult/contribute/techmethod/lock/' + data,
      method: 'get',
  })
}

//导出
export function getExport(data: any,fileName) {
  const params = {
    method:'post',
    url: proxy.CHECC_API_CMS + '/kjsl/tresult/contribute/techmethod/export',
    data,
    fileName
  }
  return exportMethod(params)
}

//导出
// export function getExport(data: any,fileName)=> {
//   const params = {
//     method:'post',
//     url: proxy.CHECC_API_CMS  + '/kjsl/tresult/contribute/techmethod/export',
//     data:data,
//     fileName:fileName
//   }
//   return exportMethod(params)
// }

//批量删除
export function getDelect(id:any) {
  return request({
    method: 'delete',
    url: proxy.CHECC_API_CMS + '/kjsl/tresult/contribute/techmethod/delete/' + id,
  })
}

//确认
export function getConfirm(data: any) {
  return request({
    url: proxy.CHECC_API_CMS + `/kjsl/tresult/contribute/techmethod/confirm`,
    method: 'post',
    data
  })
}